package com.newgrand.controller;

import com.newgrand.model.QueryModel;
import com.newgrand.model.QueryResModel;
import com.newgrand.service.QueryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author ZhaoFengjie
 * @version 1.0
 * @date 2022/7/5 11:34
 */
@Api(tags ="公共查询接口")
@RequestMapping("/Common")
@RestController
public class QueryController {

    @Autowired
    private QueryService queryData;

    @ApiOperation(value = "公共查询接口", notes = "公共查询接口", produces = "application/json")
    @RequestMapping(value = "/Query/{type}", method = RequestMethod.POST)
    QueryResModel query(@PathVariable String type, @RequestBody QueryModel queryModel) {
        return queryData.queryData(type, queryModel);
    }
}
